﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace SquareTasks.Models
{
    public enum Etat { EnCours=0, Historique=1, Corbeille=2};

    public class Tasks
    {
        public int Id { get; set; }
        public String Objet { get; set; }
        public String Description { get; set; }
        public int priorite { get; set; }
        public DateTime dateCreation { get; set; }
        public string lieu { get; set; }
        public virtual Category Categorie { get; set; }

        /// <summary>
        /// Ne pas utiliser. Usage interne.
        /// </summary>
        public virtual int EtatId { get; set; } //TODO: limiter la visibilité

        [NotMapped]
        public Etat EtatTache
        {
            get
            {
                return (Etat)EtatId;
            }
            set
            {
                EtatId = (int)value;
            }
        }
        public Boolean favori { get; set; }
        public string viderBase { get; set; }
    }
}